import os
import shutil
import tqdm


file_dir = r'/media/hjh/workdir/0_Deep_Learning/BBAVectors-Oriented-Object-Detection/data_dir/DOTA_val/images/'
path = r'/media/hjh/workdir/0_Deep_Learning/BBAVectors-Oriented-Object-Detection/data_dir/DOTA/images/'
datanames = os.listdir(file_dir)
for dataname in tqdm.tqdm(datanames):
    if os.path.splitext(dataname)[1] == '.xml':#目录下包含.json的文件
        # print("copy " + dataname)
        shutil.copy(file_dir + dataname, path + dataname)
